home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Online / AmigaTalk / intuition / BOOPSIComms.st < prev    next >
Text File  |  2002-05-20  |  2KB  |  51 lines

  1. " -------------------------------------------------------------------- "
  2. " ICClass Class is a Singleton class that allows the user to           "
  3. " reference BOOPSI inter-communication class tags' hexadecimal values. "
  4. ""
  5. " The User does NOT need to create one of these, since Intuition Class "
  6. " will instantiate the only needed instance of this Class.  See the    "
  7. " SetupIntuition.st source file for the method(s) that help the User   "
  8. " with this Class.                                                     "
  9. ""
  10. "  EXAMPLE:  'myTag <- intuition getICClass: #ICA_MAP'                 "
  11. ""
  12. " ALL singleton classes MUST contain the following:                    "
  13. ""
  14. "   the methods:  isSingleton AND privateSetup     AND                 "
  15. "                 uniqueInstance Class instance variable.              "
  16. " -------------------------------------------------------------------- "
  17.  
  18. Class ICClass :Dictionary ! uniqueInstance !
  19. [
  20.    isSingleton
  21.      ^ true  
  22. |  
  23.    privateNew ! newinstance !
  24.      newinstance <- super new.
  25.  
  26.      ^ newinstance
  27. |
  28.    new
  29.      ^ self privateSetup
  30. |
  31.    privateSetup
  32.      (uniqueInstance isNil)
  33.        ifTrue: [uniqueInstance <- self privateNew.
  34.  
  35.                 "ICM_ Tags take no parameters:"
  36.                 self at: #ICM_Dummy      put: 16r401.
  37.                 self at: #ICM_SETLOOP    put: 16r402.
  38.                 self at: #ICM_CLEARLOOP  put: 16r403.
  39.                 self at: #ICM_CHECKLOOP  put: 16r404.
  40.                 
  41.                 self at: #ICA_Dummy      put: 16r80040000.
  42.                 self at: #ICA_TARGET     put: 16r80040001.
  43.                 self at: #ICA_MAP        put: 16r80040002.
  44.  
  45.                 self at: #ICSPECIAL_CODE put: 16r80040003.
  46.                 self at: #ICTARGET_IDCMP put: 16rFFFFFFFF.
  47.                ].
  48.                
  49.      ^ self    "or ^ uniqueInstance??"
  50. ]
  51.